home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
C64
/
T-TPUG Old Monthly Disks
/
(c)tf.d64
/
drink & drive.c
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2007-02-04
|
3KB
|
82 lines
5 FORO=1TO20
10 PRINT"[147][158]DRINK AND DRIVE RATER"
20 PRINT"BY J.L. SMITH
30 [143]498 GUY, TWO MOUNTAINS, QUEBEC J7R 1V8
32 [129]I[178]1[164]10:[130]
33 [153]"DRINK AND DRIVE RATER"
34 [153]" BY J.L. SMITH
35 FORI=1TO10:NEXT:NEXT
40 PRINT"[147]DRINK & DRIVE RATER"
50 INPUT"M[146]ALE OR F[146]EMALE";S$:IFS$="M"THENSE$=" MALE"
60 INPUT"WEIGHT(LBS.)";W :IFS$="F"THENSE$=" FEMALE"
65 PRINT"ONE DRINK EQUALS-
66 [153]"1 1/2 OUNCES OF HARD LIQUOR"
67 [153]"12 OUNCE BOTTLE BEER (NORMAL)
68 PRINT"5 OUNCE WINEHIT ANY KEY-" "
69 [161]A$:[139]A$[178]""[167]69
70 [153]"LOAD" SE$" "W" POUNDS"
80 [153]"BASED ON A MAXIMUM LIMIT FOR DRIVING OF .08% CONCENTRATION OF BLOOD ALCOHOL
85 PRINT"1. MAXIMUM NUMBER OF DRINKS IN X HOURS"
90 PRINT"2. HOURS TO WAIT AFTER X DRINKS"
100 PRINT"3. MAXIMUM NUMBER OF DRINKS IN 1 HOUR"
105 PRINT"4. CALCULATE BLOOD ALCOHOL LEVEL"
106 PRINT"5. NEW PERSON "
110 INPUT"ENTER NUMBER";N
120 ONNGOSUB1000,2000,3000,4000,5000
130 GOTO70
1000 PRINT"[147]MAXIMUM NUMBER OF DRINKS"
1010 INPUT"OVER HOW MANY HOURS";H:IFS$="F"THEN1100
1011 X=W/100:FT=.043/X
1020 IFS$="M"THENT=.08/FT+.015/FT*H
1030 T%=T*10:T=T%/10 :PRINT""T"DRINKS IN "H" HOURS":FA%=T/H*10:FA=FA%/10
1040 PRINT"OR "FA" PER HOUR"
1045 PRINT"HIT ANY KEY"
1050 GETA$:IFA$=""THEN1050
1099 RETURN
1100 X=W/100:FT=.050/X
1120 T=.08/FT+.015/FT*H
1130 T%=T*10:T=T%/10 :PRINT""T"DRINKS IN "H" HOURS":FA%=T/H*10:FA=FA%/10
1140 PRINT"OR "FA" PER HOUR"
1145 PRINT"HIT ANY KEY"
1150 GETA$:IFA$=""THEN1150
1999 RETURN
2000 PRINT"[147]HOURS TO WAIT"
2010 INPUT"NUMBER IF DRINKS";ND :IFS$="F"THEN2500
2030 NH=((.043*100/W)*ND-.08)/.015
2032 PRINT"FOR A BLOOD ALCOHOL LEVEL OF .08% THEN YOU MUST WAIT "NH" HOURS."
2035 PRINT"SINCE YOUR FIRST DRINK."
2040 PRINT"HIT ANY KEY"
2050 GETA$:IFA$=""THEN2050
2499 RETURN
2500 NH=((.050*100/W)*ND-.08)/.015
2532 PRINT"FOR A BLOOD ALCOHOL LEVEL OF .08% THEN YOU MUST WAIT "NH" HOURS."
2535 PRINT"SINCE YOUR FIRST DRINK."
2540 PRINT"HIT ANY KEY"
2550 GETA$:IFA$=""THEN2550
2999 RETURN
3000 PRINT"[147]MAMIMUM DRINKS IN ONE HOUR"
3010 IFS$="M"THENPRINT"ARE ".08/(.043/(W/100))
3020 IFS$="F"THENPRINT"ARE ".08/(.050/(W/100))
3040 PRINT"HIT ANY KEY"
3050 GETA$:IFA$=""THEN3050
3999 RETURN
4000 PRINT"[147]BLOOD ALCOHOL LEVEL"
4010 INPUT"NUMBER IF DRINKS";ND
4020 INPUT"NUMBER OF HOURS";NH:IFS$="F"THEN4500
4030 BA=(.043*100/W)*ND-(NH*.015):B%=BA*1000:BA=B%/1000
4032 PRINT"BLOOD ALCOHOL LEVEL ="BA"%"
4033 BL=(BA-.08)/.015:BL%=BL*10:BL=BL%/10
4034 IFBA>.08THENPRINT"YOU MUST NOT DRIVE FOR "BL" HOURS"
4040 PRINT"HIT ANY KEY"
4050 GETA$:IFA$=""THEN4050
4499 RETURN
4500 BA=(.050*100/W)*ND-(NH*.015):B%=BA*1000:BA=B%/1000
4532 PRINT"BLOOD ALCOHOL LEVEL ="BA
4533 BL=(BA-.08)/.015:BL%=BL*10:BL=BL%/10
4534 IFBA>.08THENPRINT"YOU MUST NOT DRIVE FOR "BL" HOURS"
4540 PRINT"HIT ANY KEY"
4550 GETA$:IFA$=""THEN4550
4600 RETURN
4999 RETURN
5000 RUN